Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [open-formulieren/open-forms#4772] Set select dataType to string #58

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

stevenbal
Copy link
Contributor

@stevenbal stevenbal commented Nov 11, 2024

Fixes open-formulieren/open-forms#4772 partially

because Select components did not have a dataType set, formio tries to cast it to other types if possible, which causes issues when submitting the data to the backend. For that reason we set the value to string to avoid this unwanted normalization

because Select components did not have a dataType set, formio tries to cast it to other types if possible, which causes issues when submitting the data to the backend. For that reason we set the value to string to avoid this unwanted normalization
Copy link
Member

@sergei-maertens sergei-maertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified if this also happens for radio and selectboxes components?

@stevenbal
Copy link
Contributor Author

@sergei-maertens I forgot to mention it, I checked those as well and radio sets the dataType to string, so that doesn't cause issues. Selectboxes uses the value as keys in the post data, which automatically turns them into strings as well: {"1": True, ...}

image

@sergei-maertens sergei-maertens merged commit 6af97da into main Nov 12, 2024
6 checks passed
@sergei-maertens sergei-maertens deleted the issue/4772-select-component-datatype-string branch November 12, 2024 08:40
@sergei-maertens
Copy link
Member

Discussed in the office - we will not do patch releases for the types/formio-builder to address this for older Open Forms versions (2.7, 2.8), but instead do a runtime, backported fix in the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

int as value of select component issue
2 participants